home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue61 / Clinic / HintEg2U.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-06-28  |  1.0 KB  |  46 lines

  1. unit HintEg2U;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ComCtrls, AppEvnts;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     StatusBar1: TStatusBar;
  12.     Edit1: TEdit;
  13.     Button1: TButton;
  14.     CheckBox1: TCheckBox;
  15.     Label1: TLabel;
  16.     Memo1: TMemo;
  17.     RadioButton1: TRadioButton;
  18.     chkSimpleText: TCheckBox;
  19.     ApplicationEvents1: TApplicationEvents;
  20.     procedure chkSimpleTextClick(Sender: TObject);
  21.     procedure ApplicationEvents1Hint(Sender: TObject);
  22.   end;
  23.  
  24. var
  25.   Form1: TForm1;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TForm1.chkSimpleTextClick(Sender: TObject);
  32. begin
  33.   StatusBar1.SimplePanel := chkSimpleText.Checked
  34. end;
  35.  
  36. procedure TForm1.ApplicationEvents1Hint(Sender: TObject);
  37. begin
  38.   { Write current component hint on status bar }
  39.   if StatusBar1.SimplePanel or (StatusBar1.Panels.Count = 0) then
  40.     StatusBar1.SimpleText := Application.Hint
  41.   else
  42.     StatusBar1.Panels[0].Text := Application.Hint
  43. end;
  44.  
  45. end.
  46.